const userTabel = {
  state: {
    info: [],
  },
  mutations: {
    get_Urer_Info(state, value) {
      state.info = value;
    },
  },
  getters: {
    root(state) {
      let root = 0;
      let flag_length = state.info.length;
      for (let i = 0; i < flag_length; i++) {
        let flag = state.info[i].Class;
        if (flag === "root") {
          root++;
        }
      }
      return root
    },
    user(state) {
      let user = 0;
      let flag_length = state.info.length;
      for (let i = 0; i < flag_length; i++) {
        let flag = state.info[i].Class;
        if (flag === "user") {
          user++;
        }
      }
      return user
    },
    online(state) {
      let online = 0;
      let flag_length = state.info.length;
      for (let i = 0; i < flag_length; i++) {
        let flag = state.info[i].Status
        if (flag === true) {
          online++
        }
      }
      return online;
    },
    noOnline(state){
      let noOnline = 0;
      let flag_length = state.info.length;
      for (let i = 0; i < flag_length; i++) {
        let flag = state.info[i].Status
        if (flag === false) {
          noOnline++
        }
      }
      return noOnline;
    }

  }
};

export default userTabel;
